package com.h3c.nem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.h3c.nem.dto.TbTeacherAllowanceDTO;
import com.h3c.nem.entity.TbTeachSchedule;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface TbTeachScheduleMapper extends BaseMapper<TbTeachSchedule> {
    List<TbTeacherAllowanceDTO> selectWorkerTeacher(TbTeacherAllowanceDTO params);

    @Update("UPDATE tb_teach_schedule set end_date = #{endDate} WHERE worker_id = #{workerId} AND end_date is null")
    void updateByEndDate(@Param("workerId")String workerId,@Param("endDate") Date endDate);
}